<template>
	<view class="index-content">
		<view class="topmain">
			<view class="topmain_top">
				<view class="disflex">
					<view class="mab fot21">¥ {{datas.balance || 0}}</view>
					<view>当前余额</view>
				</view>
				<view class="txbtn" @click="withdrawal_btn">提现</view>
			</view>
			<view class="topmain_bot">
				<view class="disflex">
					<view class="mab">¥ {{datas.totalIncome || 0}}</view>
					<view>累计收益</view>
				</view>
				<view class="disflex">
					<view class="mab">¥ {{datas.stayAmount || 0}}</view>
					<view>待分账</view>
				</view>
				<view class="disflex">
					<view class="mab">¥ {{datas.totalWithdrawal || 0}}</view>
					<view>提现金额</view>
				</view>
			</view>
		</view>
		<view class="topmain_bot sssa">
			<view class="disflex">
				<view class="mab fff">去绑定</view>
				<view class="fdsa">支付宝</view>
			</view>
			<view class="disflex">
				<view class="mab fff">去绑定</view>
				<view class="fdsa">微信</view>
			</view>
			<view class="disflex">
				<view class="mab fff">3</view>
				<view class="fdsa">银行卡</view>
			</view>
		</view>
		<button type="default" style="background-color: #fff;" @tap="gomsg()">消息通知</button>
		<view class="txjl">
			<view class="txjlname">提现记录</view>
			<view class="txjllist">
				<view class="sadlist" v-for="(item,index) in txlist">
					<view class="mnum">￥{{item.amount}}</view>
					<view class="bot">
						<view class="botti">{{item.createTime}}</view>
						<view class="from">{{item.payMode}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		barCounterInfo,
		Turnover
	} from '@/api/user.js'
	export default {
		data() {
			return {
				datas: {},
				txlist:[]
			}
		},
		onShow() {
			this.page()
		},
		methods: {
			page() {
				barCounterInfo().then(res => {
					this.datas = res.data
					Turnover({
						pageNum: 1,
						pageSize: 50,
						source: '提现',
						barCounterInvestorId:res.data.barCounterInvestorId
					}).then(res => {
						console.log(res)
						this.txlist = res.data.list
					})
				})
			},
			gomsg() {
				uni.navigateTo({
					url: '/pages/center/msg?barCounterInvestorId='+ this.datas.barCounterInvestorId
				})
			},
			withdrawal_btn() {
				uni.navigateTo({
					url: '/pages/withdrawal/index'
				})
			},
		}
		// logout () {
		//   const app = this
		//   app.$store.dispatch('Logout').then(res => {
		//     uni.reLaunch({
		//       url: '/pages/login/index'
		//     })
		//   })
		// }
	}
</script>

<style lang="scss" scoped>
	.index-content {
		margin: 20rpx;
	}

	.topmain {
		padding: 40rpx;
		height: 250rpx;
		border-radius: 20rpx;
		background-color: #ceb78f;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		.disflex {
			font-weight: 600;
			color: #ffffff;

			.mab {
				margin-bottom: 20rpx;
			}
		}

		.topmain_top {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.fot21 {
				font-size: 42rpx;
			}

			.txbtn {
				padding: 12rpx 50rpx;
				background-color: #ffffff;
				color: #c68c21;
				border-radius: 50rpx;
			}
		}

	}

	.topmain_bot {
		display: flex;
		justify-content: space-between;
	}

	.sssa {
		padding: 30rpx;
	}

	.fff {
		margin-bottom: 20rpx;
		font-weight: 600;
		text-align: center;
	}
 
	.fdsa {
		opacity: 0.6;
		text-align: center;
	}
	.txjl {
		.txjlname {
			opacity: 0.6;
			font-size: 28px;
		}

		.txjllist {
			.sadlist {
				margin-bottom: 50rpx;

				.mnum {
					font-weight: 600;
					margin-bottom: 20rpx;
				}

				.bot {
					display: flex;
					justify-content: space-between;
					font-size: 28rpx;
					opacity: 0.6;

					.botti {}

					.from {}
				}
			}
		}
	}
</style>